package com.example.host.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 远程被控端状态信息封装类
 */
@TableName(value ="REMOTE_COMPUTER_STATUS")
@Data
public class ComputerInfo implements Serializable {
    //无线网卡mac地址
    //@TableField(value = "MAC_ADDRESS")
    @TableField(exist = false)
    private String macAddress;
    //公网IP
    //@TableField(value = "PUBLIC_IP")
    @TableField(exist = false)
    private String publicIP;
    //状态信息接收时间
    @TableField(value = "RECEIVE_TIME")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date msgTime;
    //被控端当前状态：等待连接(waiting)/正在连接(connecting)
    @TableField(value = "STATUS")
    private String status;
    //被控端磁盘信息
    @TableField(value = "HARD_DISK_INFO")
    private String hardDiskInfo;
    //被控端设备名称
    @TableField(value = "DEVICE_CLIENT_ID")
    private String deviceClientId;

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String msgTimeFormat = sdf.format(msgTime);
        return "ComputerInfo{" +
                "msgTime=" + msgTimeFormat +
                ", status='" + status + '\'' +
                ", hardDiskInfo='" + hardDiskInfo + '\'' +
                ", deviceClientId='" + deviceClientId + '\'' +
                '}';
    }
}